<template>
 <div>
     <h1>用户</h1>
 </div>
</template>

<script>
export default {
    data(){
         return{}
    },
    created(){},
    methods:{},
    components:{},
    // 在渲染该组件之前
    beforeRouteEnter (to, from, next) {
        // ...
        console.log('在渲染该组件之前')
        // console.log(this)
        next(vm=>{
            console.log(vm)
        })
    },
    // 离开组件
    beforeRouteLeave (to, from, next) {
        // ...
        console.log('离开组件')
        next()
    }
}

</script>
<style scoped>
</style>